unit Unit22;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
  StdCtrls, Buttons;

type

  { TForm22 }

  TForm22 = class(TForm)
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    Edit1: TEdit;
    Label1: TLabel;
    Panel1: TPanel;
    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    procedure FormShow(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form22: TForm22;

implementation

uses
  unit19  // narzedzia
  ;

{ TForm22 }

procedure TForm22.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
  if ((form22.ModalResult = mrOK) and IsFloat(edit1.Text)) or
     ( form22.ModalResult = mrCancel)
  then CloseAction:=caHide
  else
    begin
      CloseAction:=caNone;
      ShowMessage('Proszę podac poprawna liczba !');
    end;
end;

procedure TForm22.FormShow(Sender: TObject);
begin
  ActiveControl:=Edit1;
end;

{$R *.lfm}

end.

